--[[ $Id: Options.lua 57673 2007-12-30 14:59:44Z darkimakuni $ ]]

local L = Rock("LibRockLocale-1.0"):GetTranslationNamespace("TeamSqueak")

TeamSqueak:SetConfigTable({
	name = "TeamSqueak", desc = "Shows you who is using their Push To Talk button in communication programs such as TeamSpeak",
	icon = "Interface\\Common\\VoiceChat-On", type = 'group', handler = TeamSqueak, args = {
		{
			name = L["Open"], type = 'execute', buttonText = L["Open"], order = 1,
			desc = L["Show the list of names."],
			func = function() Rock("Tablet-2.0"):Open("TeamSqueak_List") end,
		},
		{
			name = L["Close"], type = 'execute', buttonText = L["Close"], order = 2,
			desc = L["Hide the list of names."],
			func = function() Rock("Tablet-2.0"):Close("TeamSqueak_List") end,
		},

		{
			name = L["Push To Talk"], type = 'keybinding', order = 3,
			desc = L["Select the button to act as your Push To Talk button."],
			get = function() return GetBindingKey("TEAMSQUEAK") end,
			set = function(key) SetBinding(key, "TEAMSQUEAK") end,
			keybindingExcept = function() return { GetBindingKey("SCREENSHOT") } end,
		},

		{
			name = L["Colors"], type = 'group', order = 4,
			desc = L["Set the text color of users names depending on their rank."], args = {
				{
					name = L["Raid/Party Leaders"], type = 'color', order = 4.1,
					desc = L["Set the text color for raid/party leaders."],
					get = function() return TeamSqueak.db.profile.groupLeader.r, TeamSqueak.db.profile.groupLeader.g, TeamSqueak.db.profile.groupLeader.b end,
					set = function(r, g, b) TeamSqueak.db.profile.groupLeader = { r = r, g = g, b = b } end,
				},
				{
					name = L["Raid Officers"], type = 'color', order = 4.2,
					desc = L["Set the text color for raid officers."],
					get = function() return TeamSqueak.db.profile.groupOfficer.r, TeamSqueak.db.profile.groupOfficer.g, TeamSqueak.db.profile.groupOfficer.b end,
					set = function(r, g, b) TeamSqueak.db.profile.groupOfficer = { r = r, g = g, b = b } end,
				},
				{
					name = L["Raid/Party Members"], type = 'color', order = 4.3,
					desc = L["Set the text color for raid/party members."],
					get = function() return TeamSqueak.db.profile.groupMember.r, TeamSqueak.db.profile.groupMember.g, TeamSqueak.db.profile.groupMember.b end,
					set = function(r, g, b) TeamSqueak.db.profile.groupMember = { r = r, g = g, b = b } end,
				},
			},
		},

		{
			name = L["Purge"], type = 'execute', buttonText = L["Purge"], order = 5,
			desc = L["Remove all names from the list. Useful if names appear to be stuck."],
			func = "Purge",
		},
	},
})
